package com.gzz.orchid.context.application.rbac.convert;

import com.gzz.orchid.context.application.rbac.command.OrganizationSaveCmd;
import com.gzz.orchid.context.application.rbac.pojo.OrganizationDto;
import com.gzz.orchid.context.application.rbac.pojo.OrganizationVo;
import com.gzz.orchid.context.infrastructure.definition.Status;
import com.gzz.orchid.context.infrastructure.persistence.entity.sys.SysOrganizationPo;
import org.mapstruct.Mapper;
import org.mapstruct.MappingTarget;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;

/**
 * @author higmd
 */
@Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE, imports = {Status.class})
public interface OrganizationConverter {
    OrganizationConverter INSTANCE = Mappers.getMapper(OrganizationConverter.class);

    OrganizationVo mapVo(SysOrganizationPo po);

    void updatePo(@MappingTarget SysOrganizationPo po, OrganizationSaveCmd cmd);

    OrganizationDto mapDto(SysOrganizationPo po);
}
